<template>
	<view class="">
		<view class="block_4 flex-row" v-for="(item,index) in list" :key="index">

			<image class="image_2" referrerpolicy="no-referrer" :src="item.prizeImage" />
			<view class="box_6 flex-col">
				<view class="text_6 dis justify-between">
					<view class="line1">{{item.prizeName}}</view>

				</view>
				<!-- <view class="text_6">产量:2斤</view> -->
				<view class="text_6">{{item.createTime}}</view>
				<view class="box_7 flex-row">
					<!-- <view class="text_9">生长进度:</view> -->
					<!-- <view class="group_1 flex-col">
						<progress percent="20" border-radius="30" show-info stroke-width="6" />
					</view> -->
					<view class="text_10">
						<view @click="open('ljlq',item)" v-if="item.status==0">立即领取</view>
						<view @click="open('kdxx',item)" v-if="item.status==1">查看信息</view>
						<!-- <uni-number-box v-model="vModelValue"  /> -->
					</view>
				</view>
			</view>
		</view>
		<uni-popup ref="popup" type="center">
			<view class="safeguardPup-wrap">

				<view class="safeguardPup-head safeguardPup-head1 dis">
					<view class="">

					</view>
					<view class="safeguardPup-head-center">快递信息</view>
					<view class="safeguardPup-head-right" @click="this.$refs.popup.close()">
						<image src="@/static/com/icon_close.png" mode=""></image>
					</view>
				</view>
				<view class="safeguardPup-msg dis">
					<view class="safeguardPup-msg-msg safeguardPup-msg-msg1">收货地址：</view>
					<view class="safeguardPup-msg-msg">{{kdxx.address||'暂无'}}</view>
				</view>
				<view class="safeguardPup-msg dis">
					<view class="safeguardPup-msg-msg safeguardPup-msg-msg1">物流公司：</view>
					<view class="safeguardPup-msg-msg">{{kdxx.deliveryName||"暂无"}}</view>
				</view>
				<view class="safeguardPup-msg dis">
					<view class="safeguardPup-msg-msg safeguardPup-msg-msg1">快递单号：</view>
					<view class="safeguardPup-msg-msg">{{kdxx.deliveryId||"暂无"}}
						<text class="safeguardPup-msg-msg-tit" @click="copy(kdxx.deliveryId)">复制</text>
					</view>
				</view>
				<view class="btns" style="margin: 0 auto;" @click="this.$refs.popup.close()">
					知道了
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import {
		getLotteryUserList
	} from '@/api/togeterRich/index.js'
	export default {
		data() {
			return {
				list: [],
				kdxx: {}
			}
		},
		onShow() {
			this.init()
		},
		methods: {
			init() {
				getLotteryUserList().then(res => {
					this.list = res.data
					console.log(res, 'wp d')
				})
			},
			copy(msg) {
				uni.setClipboardData({
					data: msg,
					success: () => {
						uni.showToast({
							title: '复制成功'
						});
					},
					fail: () => {
						uni.showToast({
							title: '复制失败',
							icon: 'none'
						});
					}
				});
			},
			open(type, item) {
				this.kdxx = {}
				let data = encodeURIComponent(JSON.stringify(item));
				if (type == 'ljlq') {
					uni.navigateTo({
						url: '/pagesA/poinTraffle/myPrize/pay?item=' + data
					})
				} else if (type == "kdxx") {
					this.kdxx = item
					this.$refs.popup.open()
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/pagesB/fosterOrder/com/obtainable.css';
	@import '@/com/css/common.css';

	.safeguardPup-wrap {
		.safeguardPup-msg {
			width: 80%;

			margin: 30rpx auto;
			justify-content: space-between;
			font-size: 28rpx;
			flex-direction: column;

			.safeguardPup-msg-msg1 {
				color: #999;
			}

			.safeguardPup-msg-msg {

				font-size: 26rpx;

				.safeguardPup-msg-msg-tit {
					color: $maincolor;
					margin-left: 20rpx;
				}
			}

			.safeguardPup-msg-img {
				width: 250rpx;
				height: 250rpx;
				margin: 30rpx auto;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}

		.safeguardPup-head1 {
			justify-content: space-between;
			padding: 36rpx 36rpx 0 36rpx;

			image {
				width: 50rpx;
				height: 50rpx;
			}
		}


		width: 600rpx;
		height: 600rpx;
		background: #fff;
		border-radius: 20rpx;
	}

	.text_10 {
		view {
			width: 150rpx;
			text-align: center;
			height: 54rpx;
			background: $maincolor;
			border-radius: 60rpx;
			margin-right: 20rpx;
			opacity: 1;
			line-height: 54rpx;
			color: #fff;
		}
	}
</style>